package cn.javass.dp.observer.example4;

public class Client {

    public static void main(String[] args) {
        WaterQuality subject = new WaterQuality();

        Watcher watcher = new Watcher();
        Watcher watcher1 = new Watcher();
        Watcher watcher2 = new Watcher();
        watcher.setJob("监测人员");
        watcher1.setJob("管理人员");
        watcher2.setJob("领导人员");


        subject.attach(watcher);
        subject.attach(watcher1);
        subject.attach(watcher2);


        System.out.println(" 当前水质为正常的时候");
        subject.setPolluteLevel(0);
        System.out.println(" 当前水质为警告的时候");
        subject.setPolluteLevel(1);
        System.out.println(" 当前水质为污染的时候");
        subject.setPolluteLevel(2);


    }
}
